# - Try to find libzmq
# Once done, this will define
#
#  ZeroMQ_FOUND - system has libzmq
#  ZeroMQ_INCLUDE_DIR - the libzmq include directories
#  ZeroMQ_LIBRARIES - link these to use libzmq

IF (UNIX)
  # Include dir
  find_path(ZeroMQ_INCLUDE_DIR
    NAMES zmq.h
    PATHS ${ZEROMQ_ROOT}/include ${ZeroMQ_PKGCONF_INCLUDE_DIRS}
  )

  # Finally the library itself
  find_library(ZeroMQ_LIBRARY
    NAMES zmq
    PATHS ${ZEROMQ_ROOT}/lib ${ZeroMQ_PKGCONF_LIBRARY_DIRS}
  )
ELSEIF (WIN32)
  find_path(ZeroMQ_INCLUDE_DIR
    NAMES zmq.h
    PATHS ${ZEROMQ_ROOT}/include ${CMAKE_INCLUDE_PATH}
  )
  # Finally the library itself
  find_library(ZeroMQ_LIBRARY
    NAMES libzmq
    PATHS ${ZEROMQ_ROOT}/lib ${CMAKE_LIB_PATH}
  )
ENDIF()

# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(ZeroMQ_PROCESS_INCLUDES ZeroMQ_INCLUDE_DIR ZeroMQ_INCLUDE_DIRS)
set(ZeroMQ_PROCESS_LIBS ZeroMQ_LIBRARY ZeroMQ_LIBRARIES)